# 计算 Ax = 0 的解
import numpy as np
from scipy.linalg import null_space

if __name__ == '__main__':
    A = np.array([
        [1, 3, 0, 2], [0, 0, 1, 4], [1, 3, 1, 6]
    ])

    ns = null_space(A)
    print(ns)
    # print(ns.ndim)
    # 将 numpy 中的二维数组按照列分解

    # print(ns[:, 0])
    for i in range(ns.ndim):
        # print(ns[:, i])
        print("x"+str(i),end="")
        print(ns[:, i])

    print(ns.T)





